Component({

  properties: {
    show:{
      type: Boolean,
      value: false
    },

    balanceMoney: {
      type: Number || String,
      value: 0
    },

    WeCahtMoney: {
      type: Number|| String,
      value: 0
    },

    radioColor: {
      type:String
    }

  },

  methods: {

    /*余额支付*/ 
    _balance(e){
      let balance = e.currentTarget.dataset.balance;

      if(balance > 0){
        let params = {
          balance: balance
        };
        this.triggerEvent('balance', params);
      }else{
        wx.showToast({
          title: '金额不足',
          icon: 'none',
          mask: true
        });
      }
     
    },

    /*微信支付*/ 
    _WeCaht(e){
      // let money = e.currentTarget.dataset.money;
      
      // if(money > 0){
      //   let params = {
      //     money: e.currentTarget.dataset.money
      //   };
      //   this.triggerEvent('WeCaht', params);
      // } else {
      //   wx.showToast({
      //     title: '金额不足',
      //     icon: 'none',
      //     mask: true
      //   });
      // }
    },

    /*取消*/ 
    _cancel(){
      this.setData({
        show: false
      });
    },

    /*确定*/ 
    _confirm(e){
      let td = this.data, form_obj = e.detail.value;

      this.triggerEvent('confirm', {  
        payment: {
          type: form_obj.payment,
          value: td[form_obj.payment]
        }
      });
    }
  }
});